/**
 * Copyright (c) 2009 Netflix-Flex_API Contributors.
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy of 
 * this software and associated documentation files (the "Software"), to deal in 
 * the Software without restriction, including without limitation the rights to 
 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 
 * of the Software, and to permit persons to whom the Software is furnished to do 
 * so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in all 
 * copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE. 
 * */
package com.netflix.webapis.events
{
	import flash.events.Event;
	
	/**
	 * Result Event from any of the Netflix Services.
	 * @author jonbcampos
	 * 
	 */
	public class NetflixResultEvent extends Event
	{
		//Titles Service
		public static const AUTOCOMPLETE_SERVICE_RESULT:String = "autoCompleteServiceResult";
		public static const CATALOG_SERVICE_RESULT:String = "catalogServiceResult";
		public static const MOVIE_SERVICE_RESULT:String = "movieServiceResult";
		public static const SERIES_SERVICE_RESULT:String = "seriesServiceResult";
		public static const SEASON_SERVICE_RESULT:String = "seasonServiceResult";
		public static const PROGRAM_SERVICE_RESULT:String = "programServiceResult";
		public static const DISC_SERVICE_RESULT:String = "discServiceResult";
		public static const FILMOGRAPHY_SERVICE_RESULT:String = "filmographyServiceResult";
		//People Service
		public static const PEOPLE_SERVICE_RESULT:String = "peopleServiceResult";
		public static const PERSON_SERVICE_RESULT:String = "personServiceResult";
		//Users Service
		public static const DISC_QUEUE_RESULT:String = "discQueueResult";
		public static const INSTANT_QUEUE_RESULT:String = "instantQueueResult";
		public static const DISC_AVAIL_QUEUE_RESULT:String = "discAvailQueueResult";
		public static const INSTANT_AVAIL_QUEUE_RESULT:String = "instantAvailQueueResult";
		public static const DISC_SAVED_QUEUE_RESULT:String = "discSavedQueueResult";
		public static const INSTANT_SAVED_QUEUE_RESULT:String = "instantSavedQueueResult";
		public static const RECOMMENDATION_RESULT:String = "recommendationResult";
		public static const UPDATE_QUEUE_RESULT:String = "addToQueueResult";
		//Categories Service
		public static const GENRES_RESULT:String = "genresResult";
		public static const TV_RATINGS_RESULT:String = "tvRatingsResult";
		public static const MPAA_RATINGS_RESULT:String = "mpaaRatingsResult";
		public static const QUEUE_AVAILABILITY_RESULT:String = "queueAvailabilityResult";
		public static const TITLE_FORMATS_RESULT:String = "titleFormatsResult";
		
		public static const RESULT:String = "netflixResult";
		
		private var _result:Object;
		

		/**
		 * Returned object in valid value objects and models. 
		 * @return 
		 * 
		 */		
		public function get result():Object
		{
			return _result;
		}
		
		private var _typeOfService:String;
		/**
		 * Service Type. 
		 * @return 
		 * 
		 */		
		public function get typeOfService():String
		{
			return _typeOfService;
		}
		
		private var _rawXML:XML;
		/**
		 * Returns the raw xml fom netflix. 
		 * @return 
		 * 
		 */		
		public function get rawXML():XML {
			return _rawXML;
		}
		
		public function NetflixResultEvent(type:String, result:Object = null, typeOfService:String = null, rawXML:XML = null)
		{
			super(type);
			_result = result;
			_typeOfService = typeOfService;
			_rawXML = rawXML;
		}
		
		override public function clone():Event
		{
			return new NetflixResultEvent(type, result, typeOfService);
		}
	}
}